unit UtilLib_Global;

interface
uses
  SysUtils,AdvGrid;

function  ExePath:string;
procedure ClearAdvGrid(AAdvGrid:TAdvStringGrid;ARowCount:Integer;ADefaultRowCount:Integer=2);

implementation

function  ExePath:string;
begin
  Result:=ExtractFilePath(ParamStr(0));
end;

procedure ClearAdvGrid(AAdvGrid:TAdvStringGrid;ARowCount:Integer;ADefaultRowCount:Integer=2);
begin
  with AAdvGrid do
  begin
    BeginUpdate;
    Filter.Clear;
    filteractive:= false;
    ClearRows(1, RowCount - 1);
    RemoveRows(2, RowCount - 2);
    if ARowCount > 1 then
      RowCount:=ARowCount+1
    else
      RowCount:=ADefaultRowCount;
    EndUpdate;
  end;
end;

end.
